// https://www.acwing.com/problem/content/789/

#include <iostream>
#include <vector>

using namespace std;

vector<int> tmp_copy(100005);

void merge(vector<int>& nums, const int left, const int mid, const int right) {
    // 合并临时数组
    int t1 = left; // 左半部分的索引
    int t2 = mid + 1; // 右半部分的索引
    int k = left; // 合并后数组的索引
    for (int i=left; i <= right; i++) {
        tmp_copy[i] = nums[i];
    }

    while (t1 <= mid && t2 <= right) {
        if (tmp_copy[t1] < tmp_copy[t2]) {
            nums[k++] = tmp_copy[t1++];
        } else {
            nums[k++] = tmp_copy[t2++];
        }
    }

    while (t1 <= mid) {
        nums[k++] = tmp_copy[t1++];
    }

    while (t2 <= right) {
        nums[k++] = tmp_copy[t2++];
    }
}

void merge_sort(vector<int>& nums, const int left, const int right) {
    if (left < right) {
        // 找到中间索引
        int mid = left + (right - left) / 2;

        // 分别对左右两半进行排序
        merge_sort(nums, left, mid);
        merge_sort(nums, mid+1, right);

        // 合并已排序的两半
        merge(nums, left, mid, right);
    }
}

void merge_sort(vector<int>& nums) {
    merge_sort(nums, 0, (int) nums.size()-1);
}

int main() {
    int n;
    cin>>n;
    vector<int> nums(n);
    for(int i=0; i<n; i++) {
        cin>>nums[i];
    }
    merge_sort(nums);
    for(int i=0; i<n-1; i++) {
        cout<<nums[i]<<" ";
    }
    cout<<nums[n-1]<<endl;
    return 0;
}

